package com.lucenten.collect.timer;

import cn.quevo.core.spring.util.PropertiesUtils;
import com.lucenten.collect.gnss.runnable.GnssUnZipRunService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

@Slf4j
@Component
public class GnssTimer {
    private final static String root = new PropertiesUtils("/conf/gnss.properties").getProperties("collect.source");
    @Resource(name = "gnssUnZipRangeService")
    private GnssUnZipRunService gnssUnZipRunService;

    @Scheduled(cron = "0 0/5 * * * ?")
    public void unzip(){
        log.info("解压开始:"+ Instant.now().toEpochMilli());
        gnssUnZipRunService.run(root);
    }
}